//
//  WPWaveView.m
//  PhnixHome
//
//  Created by Levy Xu on 2018/3/7.
//  Copyright © 2018年 Levy Xu. All rights reserved.
//

#import "WPWaveView.h"
#import "WaveView.h"

@interface WPWaveView ()
@property (nonatomic, strong) WaveView *wave1;
@property (nonatomic, strong) WaveView *wave2;
@property (nonatomic, strong) WaveView *wave3;
@end

@implementation WPWaveView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _wave1 = [[WaveView alloc] initWithFrame:self.bounds];
        _wave1.waterWaveHeight = frame.size.height / 3;
        _wave1.speed = 0.015f;
        [self addSubview:_wave1];
        
        _wave2 = [[WaveView alloc] initWithFrame:self.bounds];
        _wave2.waterWaveHeight = frame.size.height / 2;
        _wave2.speed = 0.02f;
        [self addSubview:_wave2];
        
        _wave3 = [[WaveView alloc] initWithFrame:self.bounds];
        _wave3.waterWaveHeight = frame.size.height * 2 / 3;
        _wave3.speed = 0.03f;
        [self addSubview:_wave3];
        
        self.waveColor = UIColorMakeWithHex(@"4898fa");
    }
    return self;
}

-(void)setWaveColor:(UIColor *)waveColor {
    _waveColor = waveColor;
    _wave1.waveColor = [waveColor colorWithAlphaComponent:0.5];
    _wave2.waveColor = [waveColor colorWithAlphaComponent:0.75];
    _wave3.waveColor = waveColor;
}
@end
